﻿using Microsoft.AspNetCore.Mvc;
using StudentManagement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace StudentManagement.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            Student student = new Student() { Id = 1, Name = "学生1", ClassName = "班级1", Email = "测试邮箱", PhotoPath = "" };

            #region 弱类型传参到视图（不推荐）
            ViewData["pageTitle"] = "测试页面";
            ViewData["student"] = student;

            ViewBag.pageTitle = "测试页面";
            ViewBag.student = student;
            #endregion

            return View();
        }
    }
}
